package com.squid.cloud.common.enums;

import org.codehaus.jackson.annotate.JsonValue;

public enum AuditInvoiceEnum {

	// 未审核  审核中  已开票
	// 待人员审核
    AUDITING("AUDITING", "审核中"),
    // 审核通过
    PASS("PASS", "已通过"),
    // 审核未通过
    NOT_PASS("NOT_PASS", "未通过"),
    // 申请成功，待签章
    REQUEST_SUCCESS("REQUEST_SUCCESS","申请开票成功"),
    // 申请结果返回null 未知状态
    REQUEST_UNKNOWN("REQUEST_UNKNOWN","申请开票未知"),
    // 申请成功，签章成功，开票完成
	OPEN_INVOICE("OPEN_INVOICE","已开票"),
	// 开票失败
	OPEN_INVOICE_FAIL("OPEN_INVOICE_FAIL","开票失败");

    private String code;

    private String message;

    private AuditInvoiceEnum(String code , String message){
        this.code = code;
        this.message = message;
    }
    
    public static AuditInvoiceEnum code2Mode(String code) {
        for (AuditInvoiceEnum o : AuditInvoiceEnum.values()) {
            if (o.getCode().equals(code)) {
                return o;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @JsonValue
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
